package org.gdstash.description;

import java.util.Comparator;

public class AffixComparator implements Comparator<BonusInfoSort> {
    @Override
    public int compare(final BonusInfoSort bis1, final BonusInfoSort bis2) {
        final int it1 = bis1.getInfoTypeInt();
        final int it2 = bis1.getInfoTypeInt();
        if (it1 < it2) {
            return -1;
        }
        if (it1 > it2) {
            return 1;
        }
        final int type1 = bis1.getTypeInt();
        final int type2 = bis2.getTypeInt();
        if (type1 < type2) {
            return -1;
        }
        if (type1 > type2) {
            return 1;
        }
        final int tag1 = bis1.getTagInt();
        final int tag2 = bis2.getTagInt();
        if (tag1 < tag2) {
            return -1;
        }
        if (tag1 > tag2) {
            return 1;
        }
        final int prio1 = bis1.prio;
        final int prio2 = bis2.prio;
        if (prio1 < prio2) {
            return -1;
        }
        if (prio1 > prio2) {
            return 1;
        }
        return 0;
    }
}
